home *** CD-ROM | disk | FTP | other *** search
- #include <ezycom.h>
- #include <ezylib.h>
-
- /**********************************************************
- * Convert an Word to a Date
- *
- * Returns the converted date in the variables yy,mm,dd
- * and a true false value in relation to the conversion.
- *
- * eg: if (!word2date(worddate,year,mon,day)) is_error();
- **********************************************************/
- int Word2Date(word Date, word &yy, word &mm, word &dd)
- {
- word temp=Date;
-
- if (Date == 65535U) return(0); /* Invalid Date */
-
- dd = (temp & 31) + 1;
- temp >>= 5;
- mm = (temp & 15) + 1;
- temp >>= 4;
- yy = (temp & 127) + 1980;
- return(1); /* Conversion OK */
- }
-